package com.zzedu.common.enums;

import java.util.Arrays;

/**
 * 用戶类型
 */
public enum UserTypeEnumns {

    /**
     * 系统表用户
     */
    PLATFORM(1, "平台"),


    /**
     * 会员表用户
     */
    MEMBER(2, "会员");

    UserTypeEnumns(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private int code;

    private String desc;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static UserTypeEnumns getCode(int code) {
        return Arrays.stream(UserTypeEnumns.values()).filter(e -> e.getCode() == code).findFirst().orElse(null);
    }
}
